Недавно в чате наши подписчики затрагивали эту тему, поэтому мы решили разложить всё по полочкам, чтобы в дальнейшем не возникало вопросов.
Итак, оператор == проверяет равенство значений двух объектов. А оператор is в свою очередь проверяет идентичность самих объектов. Его используют, чтобы удостовериться, что переменные указывают на один и тот же объект в памяти.
Однако Python в целях производительности кеширует короткие строки и малые целые числа, поэтому возможны некоторые казусы, как в примере.
Недавно в чате наши подписчики затрагивали эту тему, поэтому мы решили разложить всё по полочкам, чтобы в дальнейшем не возникало вопросов.
Итак, оператор == проверяет равенство значений двух объектов. А оператор is в свою очередь проверяет идентичность самих объектов. Его используют, чтобы удостовериться, что переменные указывают на один и тот же объект в памяти.
Однако Python в целях производительности кеширует короткие строки и малые целые числа, поэтому возможны некоторые казусы, как в примере.
Tata Power whose core business is to generate, transmit and distribute electricity has made no money to investors in the last one decade. That is a big blunder considering it is one of the largest power generation companies in the country. One of the reasons is the company's huge debt levels which stood at ₹43,559 crore at the end of March 2021 compared to the company’s market capitalisation of ₹44,447 crore.
Telegram Gives Up On Crypto Blockchain Project
Durov said on his Telegram channel today that the two and a half year blockchain and crypto project has been put to sleep. Ironically, after leaving Russia because the government wanted his encryption keys to his social media firm, Durov’s cryptocurrency idea lost steam because of a U.S. court. “The technology we created allowed for an open, free, decentralized exchange of value and ideas. TON had the potential to revolutionize how people store and transfer funds and information,” he wrote on his channel. “Unfortunately, a U.S. court stopped TON from happening.”